"""测试启动脚本"""
import os
import sys

import pytest

from utils.feishu_utils import send_feishu_msg
from utils.logger_utils import *

if __name__ == '__main__':
    if len(sys.argv) < 2:
        print("请指定要测试的项目名称，如python run.py erp")
        sys.exit(1)
    else:
        # 在Jenkins中明确指定路径
        workspace = os.environ.get('WORKSPACE', os.getcwd())
        allure_results_path = os.path.join(workspace, "allure-results")
        test_script_path = os.path.join(workspace, "scripts", "test_main.py")

        pytest.main(["-vs", test_script_path, f"--alluredir={allure_results_path}",f"--clean-{allure_results_path}"])
        info(f"allure-result的路径是：{allure_results_path}")
